From: Georges Basile Stavracas Neto Date: Tue, 2 Jul 2019 00:37:35 +0000 (-0300) Subject: folderIcon: Add visual drag-over feedback X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~839^2^2~23 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=54a2773046a35a840cf7aebc44caa4b49552939c;p=gnome-shell.git folderIcon: Add visual drag-over feedback WIP: This is not exactly what was discussed on IRC, but it's looking alright as a first iteration. Design feedback welcomed. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664 --- diff --git a/data/theme/gnome-shell-sass/_common.scss b/data/theme/gnome-shell-sass/_common.scss index 5e377df15..8731ba48d 100644 --- a/data/theme/gnome-shell-sass/_common.scss +++ b/data/theme/gnome-shell-sass/_common.scss @@ -1514,6 +1514,9 @@ StScrollBar { border-image: none; background-image: none; } + &:drop .overview-icon { + background-color: transparentize($selected_bg_color,.15); + } &:active .overview-icon, &:checked .overview-icon { background-color: transparentize(darken($osd_bg_color,10%), 0.5); diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 6b3095eae..e283125d6 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1377,11 +1377,29 @@ var FolderIcon = class FolderIcon { } _onDragBegin() { + this._dragMonitor = { + dragMotion: this._onDragMotion.bind(this), + }; + DND.addDragMonitor(this._dragMonitor); + this._parentView.inhibitEventBlocker(); } + _onDragMotion(dragEvent) { + let target = dragEvent.targetActor; + + if (!this.actor.contains(target) || !this._canAccept(dragEvent.source)) + this.actor.remove_style_pseudo_class('drop'); + else + this.actor.add_style_pseudo_class('drop'); + + return DND.DragMotionResult.CONTINUE; + } + _onDragEnd() { + this.actor.remove_style_pseudo_class('drop'); this._parentView.uninhibitEventBlocker(); + DND.removeDragMonitor(this._dragMonitor); } _canAccept(source) {